Fast Primality Testing for Integers That Fit into a Machine Word
نویسندگان
چکیده
For large integers, the most efficient primality tests are probabilistic. However, for integers with a small fixed number of bits the best tests in practice are deterministic. Currently the best known tests of this type involve 3 rounds of the Miller-Rabin test for 32-bit integers and 7 rounds for 64-bit integers. Our main result in this paper: For 32bit integers we reduce this to a single computation of a simple hash function and a single round of Miller-Rabin. Similarly, for 64-bit integers we can reduce the number of rounds to two (but with a significantly large precomputed table) or three. Up to our knowledge, our implementations are the fastest one-shot deterministic primality tests for 32-bit and 64-bit integers to date. We also provide empirical evidence that our algorithms are fast in practice and that the data segment is roughly as small as possible for an algorithm of this type.
منابع مشابه
The power digraphs of safe primes
A power digraph, denoted by $G(n,k)$, is a directed graph with $Z_{n}={0,1,..., n-1}$ as the set of vertices and $L={(x,y):x^{k}equiv y~(bmod , n)}$ as the edge set, where $n$ and $k$ are any positive integers. In this paper, the structure of $G(2q+1,k)$, where $q$ is a Sophie Germain prime is investigated. The primality tests for the integers of the form $n=2q+1$ are established in terms of th...
متن کاملA Remark on Primality Testing and the Binary Expansion
We show that for all sufficiently large integers n, a positive fraction of the primes p between 2 and 2 have the property that p− 2 and p+2 are composite for every 0 ≤ i < n − 1. As a consequence, it is not always possible to test whether a number is prime from its binary expansion without reading all of its digits.
متن کاملDeterministic elliptic curve primality provingfor a special sequence of numbers
We give a deterministic algorithm that very quickly proves the primality or compositeness of the integers N in a certain sequence, using an elliptic curve E/Q with complex multiplication by the ring of integers of Q( √ −7). The algorithm uses O(logN) arithmetic operations in the ring Z/NZ, implying a bit complexity that is quasi-quadratic in logN . Notably, neither of the classical “N − 1” or “...
متن کاملExplicit Bounds for Primality Testing and Related Problems
Many number-theoretic algorithms rely on a result of Ankeny, which states that if the Extended Riemann Hypothesis (ERH) is true, any nontrivial multiplicative subgroup of the integers modulo m omits a number that is 0(log m). This has been generalized by Lagañas. Montgomery, and Odlyzko to give a similar bound for the least prime ideal that does not split completely in an abelian extension of n...
متن کاملPseudopowers and primality proving
The so-called pseudosquares can be employed in very powerful machinery for the primality testing of integers N . In fact, assuming reasonable heuristics (which have been confirmed for numbers to 2) they can be used to provide a deterministic primality test in time O(log N), which some believe to be best possible. In the 1980s D.H. Lehmer posed a question tantamount to whether this could be exte...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2015